Repository navigation
Add AI job A to propose rules from decision sources - #69
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #7
What this adds
codexray decisions propose --repo <id>finds the project's own decision sources at END, asks job A for one rule per source, checks every answer in code, runs each checkable rule against the map, and writes the proposals for a person to review.decisions/sources.pyfinds sources by the globs insettings/judge.yaml(job_a.sources): architecture tests, import-ban blocks in build and lint files, static-analysis rules, decision documents, guidelines and rules files for agents.<RestrictImports>runs from its first line to the next line indented no deeper.min_linesis skipped and listed with the reason.decisions/propose.pyholds the job A prompt and schema.analyze.checks.check_decisionat END.proposals.jsonshows how many links it applies to, its exceptions, and the first five exception links.rules/artemis.yaml,rules/graylog.yaml,rules/shopware.yaml: reviewed by hand, as described below.The stage writes these to the run folder:
proposals.yaml: the rules-file format, withreviewed: false.proposals.json.judgements/cache/andjudgements/calls_a.json.usage.json.Change from the issue: proposals go to
proposals.yaml, notdecisions.yaml.codexray analyzealready writesdecisions.yaml(the decisions it used) and would overwrite them.There are no new test files, per team rule 3. The
decisions proposeline is removed fromSTUBS.What I ran and saw
These ran live against the gateway, at the pinned END commits:
usage.jsonlists every job A call: 6, 59 and 393 entries.LLM_API_KEYmade 0 gateway calls, andproposals.yaml,proposals.jsonandusage.jsoncame out byte-identical. I checked this on all three repos.runs/,src/orrules/.usage.json.codexray analyzethen uses only the reviewed rules:analyze: 3 decisions (2 reviewed from rules/graylog.yaml)analyze: 49 decisions (33 reviewed from rules/artemis.yaml)analyze: 66 decisions (65 reviewed from rules/shopware.yaml)decision_checksmatch the dry runs below for every reviewed rule.shopware/core-never-imports-app-moduleis slipping, at 93%.make checkpasses.Review of the proposals
Graylog (2 reviewed)
graylog/datanode-packages-private: forbid!M:data-node→path:*/org/graylog/datanode/*, frompom.xmllines 1243–1252.graylog/no-permissions-mixin-import, from the web lint config lines 225–228.eslint-disable-next-line no-restricted-importsare its allowed exceptions.hooks/useHasEntityOwnership.tsline 19, with no disable comment.data-node/pom.xmlallowance. It is the other half of the ban and is already expressed by!M:data-node.Artemis (33 reviewed: 9 checkable, 24 written)
artemis/module-access-via-api-domain-dto: only_via with doorsapi,domainanddto, fromAbstractModuleAccessArchitectureTest.javalines 30–61.targetto those 12 and added their owngetIgnoredClasses()lists (19 classes, with their lines) as allowed exceptions.ExerciseRepository.javaimportsExamResourceonly for a{@link}in a doc comment. The project's test reads compiled classes and cannot see that; our map can.eslint.config.mjs.artemis/repositories-not-access-services.@Repositorymust not access an@Service.artemis/tum-aet-ui-no-app-imports(fromAGENTS.md), the same rule as the enforced lint block.Shopware (65 reviewed: 8 checkable, 57 written)
shopware/core-not-depend-on-bundles, fromRestrictNamespacesRule.phplines 37–49.@phpstan-ignore phpat.restrictNamespacesInCorelines are its allowed exceptions.DependencyInjection/*.php,tagged-service-contracts.php) that phpat does not check as classes.proposed_by: hand) for the Administration, Elasticsearch and Storefront bundles; each has 0 exceptions.RegisterController.php);AGENTS.md:src/meta(0 exceptions);DocumentV2, so its 84 links are by design.adr/_superseded/.AGENTS.mdcopy of the rule above;Storefront/Mcp/AGENTS.mdline that repeats the Core → Storefront ban.The written-but-not-checkable rules were skimmed against their sources, not checked line by line. They never produce a finding; the report lists them.
Spec §15 question 5
Shopware has 190 decision documents:
Merging with #67
#67 adds jobs B and C.
judge.yamlmerges cleanly; the effort line for A and B is the same change in both PRs.tests/test_cli.pyconflicts because both PRs remove neighbouringSTUBSlines. Keep both removals.